/*
    pythonswitcher  : Between python2 or python3 on your linux system
    version	    : 1.0_final
    Copyright (C) 2013  Charles-Eugene LOUBAO

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <string.h>
#include "include/switchers.h"
#include "include/version.h"

int choice;

main()
{
    printf("***************************************************************\n");
    printf("***** Python Switcher Version %d.%d.%d%s \n", VERSION_MAJOR, VERSION_MINOR, SUBVERSION, VERSION_STATE);
    printf("***** Copyright (C) 2013  Charles-Eugene LOUBAO\n");
    printf("***************************************************************\n");
    printf("Current python version is :\n");
    system("python --version");
    printf("***************************************************************\n");
    printf("*** Actions :\n");
    printf("*** 1- Switch to python2\n");
    printf("*** 2- Switch to python3\n");
    printf("*** 3- Exit\n");
    printf("***************************************************************\n");
    printf("*** What do you want to do ? (Enter a number): ");
    scanf("%d", &choice);
    
    if (choice == 1){
		switch_to_py2();
    }
    
    if (choice == 2){
		switch_to_py3();
    }
    
    if (choice == 3){
		exit;
    }
    
    while ((choice != 1) && (choice != 2) && (choice != 3)){
		printf("*** %d is not available \n", choice);
		printf("*** What do you want to do ? (Enter a number) : ");
		scanf("%d", &choice);
    }
    
    return 0;
}
    
    
